package cn.tk.scheduler;

import cn.tk.cache.mr.MrBuf;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created by denglw on 2021/8/16.<br/>
 * Desc: mr多轮缓存初始化及刷新
 */
@EnableScheduling
@Component
@Slf4j
public class MrBufTask {

    /**
     * 定时器刷新mr缓存
     */
    @Scheduled(initialDelay = 300_000, fixedDelay = 600_000)
    public void flush() {
        log.info("定时刷新mr本地缓存.");
        MrBuf.reloadBuf();
    }

}
